home *** CD-ROM | disk | FTP | other *** search
/ Java Developer's Companion / Java Developer's Companion.iso / binaries / Windows / jsdk / src / javax / servlet / http / HttpServletRequest.java < prev    next >
Encoding:
Java Source  |  1997-07-18  |  3.9 KB  |  119 lines

  1. /*
  2.  * @(#)HttpServletRequest.java    1.13 97/05/22
  3.  * 
  4.  * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.0
  20.  */
  21.  
  22. package javax.servlet.http;
  23.  
  24. import javax.servlet.ServletRequest;
  25. import java.util.Enumeration;
  26.  
  27. /**
  28.  * This interface represents an HTTP servlet request.  It gets data
  29.  * from the client to the servlet for use in the service method.  It
  30.  * allows the HTTP-protocol specified header information to be accessed
  31.  * from the service method.
  32.  *
  33.  * @version    1.13, 05/22/97
  34.  * @author    David Connelly
  35.  */
  36. public
  37. interface HttpServletRequest extends ServletRequest {
  38.     /**
  39.      * Returns the method with which the request was made. The returned
  40.      * value can be "GET", "HEAD", "POST", or an extension method. Same
  41.      * as the CGI variable REQUEST_METHOD.
  42.      */
  43.     public String getMethod();
  44.  
  45.     /**
  46.      * Returns the request URI as a URL object.
  47.      */
  48.     public String getRequestURI();
  49.  
  50.     /**
  51.      * Returns the part of the request URI that refers to the servlet
  52.      * being invoked. Analogous to the CGI variable SCRIPT_NAME.
  53.      */
  54.     public String getServletPath();
  55.  
  56.     /**
  57.      * Returns optional extra path information following the servlet
  58.      * path, but immediately preceding the query string. Returns null if
  59.      * not specified. Same as the CGI variable PATH_INFO.
  60.      */
  61.     public String getPathInfo();
  62.  
  63.     /**
  64.      * Returns extra path information translated to a real path. Returns
  65.      * null if no extra path information specified. Same as the CGI variable
  66.      * PATH_TRANSLATED.  
  67.      */
  68.     public String getPathTranslated();
  69.  
  70.     /**
  71.      * Returns the query string part of the servlet URI, or null if none.
  72.      * Same as the CGI variable QUERY_STRING.
  73.      */
  74.     public String getQueryString();
  75.  
  76.     /**
  77.      * Returns the name of the user making this request, or null if not
  78.      * known.  The user name is set with HTTP authentication.  Whether
  79.      * the user name will continue to be sent with each subsequent
  80.      * communication is browser-dependent.  Same as the CGI variable
  81.      * REMOTE_USER.
  82.      */
  83.     public String getRemoteUser();
  84.  
  85.     /**
  86.      * Returns the authentication scheme of the request, or null if none.
  87.      * Same as the CGI variable AUTH_TYPE.
  88.      */
  89.     public String getAuthType();
  90.  
  91.     /**
  92.      * Returns the value of a header field, or null if not known.
  93.      * The case of the header field name is ignored.
  94.      * @param name the case-insensitive header field name
  95.      */
  96.     public String getHeader(String name); 
  97.  
  98.     /**
  99.      * Returns the value of an integer header field, or -1 if not found.
  100.      * The case of the header field name is ignored.
  101.      * @param name the case-insensitive header field name
  102.      */
  103.     public int getIntHeader(String name);
  104.  
  105.     /**
  106.      * Returns the value of a date header field, or -1 if not found.
  107.      * The case of the header field name is ignored.
  108.      * @param name the case-insensitive header field name
  109.      */
  110.     public long getDateHeader(String name);
  111.  
  112.     /**
  113.      * Returns an enumeration of strings representing the header names
  114.      * for this request. Some server implementations do not allow headers
  115.      * to be accessed in this way, in which case this method will return null.
  116.      */
  117.     public Enumeration getHeaderNames();
  118. }
  119.